package com.hp.ssm.service.impl;

import com.github.pagehelper.PageHelper;
import com.hp.ssm.entity.User;
import com.hp.ssm.mapper.CaretakerMapper;
import com.hp.ssm.mapper.CaseMapper;
import com.hp.ssm.service.CaretakerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CaretakerServiceImpl implements CaretakerService {
    @Autowired
    private CaretakerMapper caretakerMapper;

    @Override
    public List<User> selectAll(User user,Integer page,Integer limit) {
        PageHelper.startPage(page, limit);
        return caretakerMapper.selectAll(user);
    }

    @Override
    public int add(User user) {
        return caretakerMapper.add(user);
    }

    @Override
    public int delete(int aid) {
        return caretakerMapper.delete(aid);
    }

    @Override
    public User findAll(int aid) {
        return caretakerMapper.findAll(aid);
    }

    @Override
    public int update(User user) {
        return caretakerMapper.update(user);
    }

    @Override
    public List<User> deleteAll(User user,Integer page,Integer limit) {
        PageHelper.startPage(page, limit);
        return caretakerMapper.deleteAll(user);
    }

    @Override
    public int recover(int aid) {
        return caretakerMapper.recover(aid);
    }
}
